package com.itheima.health.security;

import com.itheima.health.common.MessageConst;
import com.itheima.health.entity.Result;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：seanyang
 * @date ：Created in 2019/6/14
 * @description ：
 * @version: 1.0
 */
@RestController
@RequestMapping("/test")
public class TestSecurityController {

	@RequestMapping("/addData")
	@PreAuthorize("hasAuthority('add')")
	public String addData(){
		return "add ok";
	}

	@RequestMapping("/delData")
	@PreAuthorize("hasAuthority('delete')")
	public String deleteData(){
		return "delete ok";
	}

	@RequestMapping("findAll")
	@PreAuthorize("hasAuthority('find')")
	public String findAll(){
		return "find ok";
	}
}
